import java.util.HashSet;
import java.util.Set;

public class AveragePaperPerStudent implements Visitor {
    private int totalPapers = 0;
    private final Set<Student> students = new HashSet<>();

    @Override
    public void visit(Paper paper, Student student) {
        totalPapers++;
        students.add(student);
    }

    @Override
    public Double getResult() {
        if (students.isEmpty()) {
            return 0.0;
        }
        return (double) totalPapers / students.size();
    }
}    